Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added -bump-to-next flag to control which component to bump if pre-release #36

Merged
merged 4 commits into from
May 5, 2024

Conversation

yobeonline
Copy link
Contributor

@yobeonline yobeonline commented Feb 12, 2024

Possible values are patch (default), minor and major.

  • Readme updated
  • Unit test added
  • Changelog partially updated (release date and version is not up to me)

Closes #29

Details

I created the custom enum-like type TargetRelease VersionComp to hold values for the new flag. I gave it the Value interface (methods String and Set) so that the flags package can deal with this type on its own.

The String method for TargetRelease VersionComp panics if the integer value is not one of the enums. I don't know if it is good practice to do that (i am a golang beginner), I just felt there was no other way to deal with this case.

Using patch as default value preserves the previous behavior so that there should be no regression.

@yobeonline
Copy link
Contributor Author

I made a mistake with pr #31 which ended up being closed because it did not have the right diffs. Sorry about that.

@codecov-commenter
Copy link

codecov-commenter commented Feb 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.92%. Comparing base (5abad59) to head (18daf11).
Report is 7 commits behind head on main.

❗ Current head 18daf11 differs from pull request most recent head 5811b71. Consider uploading reports for the commit 5811b71 to get more accurate results

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #36      +/-   ##
==========================================
+ Coverage   79.59%   83.92%   +4.33%     
==========================================
  Files           3        3              
  Lines         294      280      -14     
==========================================
+ Hits          234      235       +1     
+ Misses         49       34      -15     
  Partials       11       11              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

* main:
  Update circl to fix security issues
  Update CHANGELOG
  Add direnv config
  Ignore local .devbox env
  Add devbox configuration
  Update GitHub Actions
  Update depdendencies
@mdomke
Copy link
Owner

mdomke commented Feb 25, 2024

Hej @yobeonline, I took the liberty to fix the linter issues in your pull-request. I will provide a review separately.

version/version.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
version/version.go Outdated Show resolved Hide resolved
@yobeonline yobeonline changed the title Added -target-release flag to control which component to bump if pre-release Added -bump-to-next flag to control which component to bump if pre-release May 1, 2024
@yobeonline yobeonline requested a review from mdomke May 1, 2024 06:05
@mdomke mdomke merged commit cf8b124 into mdomke:main May 5, 2024
2 checks passed
@yobeonline yobeonline deleted the target-release branch May 5, 2024 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add flags to control which component should be bumped for prereleases.
3 participants